package com.price.sample.http.person

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.price.sample.http.myinterface.ExceptionApi
import com.price.sample.http.service.ExceptionApiService
import okhttp3.ResponseBody


/**
 * ViewModel 没啥好说的
 * 把业务搬这？
 */
class HomeViewModel11(private val repo: ExceptionApi) : ViewModel() {

    companion object {
        val Factory: ViewModelProvider.Factory = object : ViewModelProvider.Factory {
            override fun <T : ViewModel> create(modelClass: Class<T>): T {
                return HomeViewModel11(ExceptionApiService.getService()) as T
            }
        }
    }

    suspend fun getBanner(): String {
        return repo.getBanner()
    }
    suspend fun getList(): ResponseBody {
        return repo.getList()
    }

    suspend fun getTest(): String {
        return repo.getTest()
    }


}